#ifndef _CellTime_hpp_
#define _CellTime_hpp_
#include<chrono>
using namespace std::chrono;

class CellTime
{

public:
	CellTime() {
		Update();
	}
	~CellTime() {

	}

	void Update() {
		_begin = high_resolution_clock::now();
	}

	long long GetMicroSecond() {
		return duration_cast<microseconds>(high_resolution_clock::now() - _begin).count();
	}

	double GetMilliSecond() {
		return this->GetMicroSecond()*0.001;
	}

	double GetSecond() {
		return this->GetMicroSecond()*0.000001;
	}

	double SetZero() {
		return this->GetMicroSecond() * 0;
	}

	std::string GetSysNow() {
		std::chrono::system_clock::time_point sysNow = std::chrono::system_clock::now();
		time_t timetSysNow = std::chrono::system_clock::to_time_t(sysNow);
		_stringSysNow = ctime(&timetSysNow);
		_stringSysNow.resize(_stringSysNow.size() - 1);
		return _stringSysNow;
	}

private:
	time_point<high_resolution_clock> _begin;
	time_point<high_resolution_clock> _end;
	std::string _stringSysNow;
};

#endif